<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/8 0008
 * Time: 下午 6:49
 */

header("Content-type:text/html;charset=utf-8");

//function getCode($length = 6)
//{
//    return rand(pow(10, $length - 1), pow(10, $length) - 1);
//}
//
//echo getCode();

//$str = 'test';
//
//$password = password_hash($str, PASSWORD_DEFAULT);//保存的
//
//$password1 = password_hash($str, PASSWORD_DEFAULT);//现传的
//
//$passwordChecked = password_verify($str . '1', $password);
//
//var_dump($password, $passwordChecked);
//
//$records = array(
//    array(
//        'id' => 2135,
//        'first_name' => 'John',
//        'last_name' => 'Doe',
//    ),
//    array(
//        'id' => 3245,
//        'first_name' => 'Sally',
//        'last_name' => 'Smith',
//    ),
//    array(
//        'id' => 5342,
//        'first_name' => 'Jane',
//        'last_name' => 'Jones',
//    ),
//    array(
//        'id' => 5623,
//        'first_name' => 'Peter',
//        'last_name' => 'Doe',
//    )
//);
//
//$first_names = array_column($records, 'first_name', 'id');
//print_r($first_names);

class test
{
    public $info = 'test';
    private $test = '1';
    private $abc = '';

    function __set($name, $value)
    {
        $this->$name = $value;
    }

    function __toString()
    {

        return;
        // TODO: Implement __toString() method.
    }
}

$test = new test();
$test->abc = 'abc';

var_dump($test);